<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录处理页面</title>
</head>
    <body>
    	<%
    		request.setCharacterEncoding("UTF-8");
    		String name=request.getParameter("username").trim();
    		String password=request.getParameter("upwd").trim();
    		boolean flag=false;
    		if(name.equals("张恒")&&password.equals("123456")){
    			flag=true;
    			session.setAttribute("name", name);
    			session.setMaxInactiveInterval(60);
    		}
    		if(flag){
    			request.getRequestDispatcher("admin.jsp").forward(request, response);
    		}else{
    			response.sendRedirect("index.jsp");
    		}
    	%>
    </body>
</html>
